When moving the cursor, compare current adjustment value with the post-animation
target value, in order to avoid false "keynav failed" positives as the animation
hasn't started yet, so dx/dy are still 0 at that time.
break;
}
- old_xpos = priv->xoffset;
- old_ypos = priv->yoffset;
+ old_xpos = gtk_adjustment_get_value (priv->hadjustment);
+ old_ypos = gtk_adjustment_get_value (priv->vadjustment);
gtk_text_view_move_viewport (text_view, scroll_step, count);
- if ((old_xpos == priv->xoffset && old_ypos == priv->yoffset) &&
+ if ((old_xpos == gtk_adjustment_get_target_value (priv->hadjustment) &&
+ old_ypos == gtk_adjustment_get_target_value (priv->vadjustment)) &&
leave_direction != -1 &&
!gtk_widget_keynav_failed (GTK_WIDGET (text_view),
leave_direction))